home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / GPC2952B.ZIP / doc / gpc / docdemos / chdirdemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-02-09  |  305 b   |  14 lines

  1. program ChDirDemo;
  2. var
  3.   Foo: String (127);
  4. begin
  5.   WriteLn ('Enter directory name to change to:');
  6.   ReadLn (Foo);
  7.   {$I-}  { Don't abort the program on error }
  8.   ChDir (Foo);
  9.   if IOResult <> 0 then
  10.     WriteLn ('Cannot change to directory `', foo, '''.')
  11.   else
  12.     WriteLn ('Okay.')
  13. end.
  14.